#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdint.h>

#include "ncu_param.h"
#ifdef DMALLOC
#include <imp/dmalloc.h>
#endif
extern ncu_param day;
extern ncu_param night;

int main(int argc, char **argv)
{
	int ret = 0;
	if (2 != argc) {
		printf("err: param error\n");
		printf("usage: cmd  ncu_jxf22.bin\n");
		return -1;
	}
	ncu_params nparams;
	nparams.size = sizeof(ncu_params);
	memcpy(&nparams.day, &day, sizeof(ncu_param));
	memcpy(&nparams.night, &night, sizeof(ncu_param));
	FILE *fp_outbin = NULL;
	fp_outbin = fopen(argv[1], "w");
	if (NULL == fp_outbin) {
		printf("err: fopen fp_outbin err\n");
		return -1;
	}
	fwrite(&nparams, sizeof(ncu_params), 1, fp_outbin);
	fclose(fp_outbin);
}
